from sls_mirrors.sls_agent import MirrorUpdate
# 基本位置镜像更新
class UGVBasicPositionMirrorUpdate(MirrorUpdate):
    """
    基本状态镜像更新
    """
    def __init__(self,parent_mirror):
        super().__init__(parent_mirror)

    def init_data(self):
        """
        初始化数据
        """
        self.GNSS_position = []
    
    def get_sub_topic(self,id:str):
        """
        初始化主题
        """
        return "/status/"+id+"/BP"

    def update(self,messageDict:dict):
        """
        更新镜像
        """
        if "GNSS_position" in messageDict:
            self.GNSS_position = messageDict["GNSS_position"]
        if "vehicle_yaw" in messageDict:
            self.vehicle_yaw = messageDict["vehicle_yaw"]
